<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Mazik.WinRT.Components.Controls">

    <Style TargetType="local:MzkSignature">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MzkSignature">
                    <Grid  Width="350" Margin="0 10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <TextBlock x:Name="title" Grid.Row="0" FontSize="18" Margin="0 0 0 10"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Background="White">
                            <Border BorderBrush="Black" BorderThickness="1" Height="172" Margin="10" Width="260" HorizontalAlignment="Left" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                                <Image Name="imgOriginator" Source="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ImageSource, Mode=TwoWay}"  Height="172" Stretch="None" Width="260"  HorizontalAlignment="Stretch" />
                            </Border>
                            <Button x:Name="myButton" Style="{StaticResource LightBtnStyle}" Grid.Column="1" Width="50" Height="50" Margin="05 8" VerticalContentAlignment="Center" VerticalAlignment="Top"  Content="&#xE1E3;" FontFamily="Segoe UI Symbol" FontSize="25" />
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LightBtnStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="grid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                            Storyboard.TargetName="rectangle"
                                                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                                            To="White"
                                                           />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="rectangle"
                                                             Storyboard.TargetProperty="(UIElement.Opacity)"
                                                             To="0.995"
                                                             />
                                        <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="grid"
                                                             Storyboard.TargetProperty="(UIElement.Opacity)"
                                                             To="0.5"
                                                            />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(ContentPresenter.Content)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Save" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                            Storyboard.TargetName="rectangle"
                                                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                                            To="#FF777777"
                                                           />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="rectangle"
                                       Fill="White"
                                       Stroke="Black"
                                       StrokeThickness="1" RadiusX="25" RadiusY="25" />
                        <ContentPresenter x:Name="contentPresenter"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Foreground="Black" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DarkBtnStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="grid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                            Storyboard.TargetName="rectangle"
                                                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                                            To="#FF000000"
                                                            />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="rectangle"
                                                             Storyboard.TargetProperty="(UIElement.Opacity)"
                                                             To="0.995"
                                                            />
                                        <DoubleAnimation Duration="0"
                                                             Storyboard.TargetName="grid"
                                                             Storyboard.TargetProperty="(UIElement.Opacity)"
                                                             To="0.5"
                                                             />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(ContentPresenter.Content)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Save" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                            Storyboard.TargetName="rectangle"
                                                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                                            To="#FF777777"
                                                          />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="rectangle"
                                       Fill="#FF444444"
                                       Stroke="White"
                                       StrokeThickness="3" RadiusX="25" RadiusY="25" />
                        <ContentPresenter x:Name="contentPresenter"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              Foreground="White" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
